//
//  BaseButton.m
//  Tour
//
//  Created by 张张烨 on 16/3/7.
//  Copyright © 2016年 张中烨. All rights reserved.
//

#import "BaseButton.h"

@implementation BaseButton


//重写button的初始化方法
//+(instancetype)buttonWithType:(UIButtonType)buttonType{
//    
//    BaseButton *baseButton = [[BaseButton alloc] init];
//    //    baseButton.backgroundColor = CLEAR;
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        baseButton.backgroundColor = COLOR_BTN_NIGHT;
//        baseButton.titleLabel.textColor = WHITE;
//    } else {
//        baseButton.backgroundColor = COLOR_BG;
//        baseButton.titleLabel.textColor = BLACK;
//    }
//    
////    [[NSNotificationCenter defaultCenter] addObserver:baseButton selector:@selector(changeColor:) name:@"changeColor1" object:nil];
////    
//    return baseButton;
//    
//}

//通知方法
//- (void)changeColor:(NSNotification *)notification{
//    
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        self.backgroundColor = COLOR_BTN_NIGHT;
//        self.titleLabel.textColor = COLOR_NORMAL;
//        
//    } else {
//        self.backgroundColor = COLOR_BG;
//        self.titleLabel.textColor = COLOR_NORMAL;
//        
//    }
//    //    self.backgroundColor = CLEAR;
//}

//重写dealloc 删除通知
//-(void)dealloc
//{
//    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor1" object:nil];
//  
//}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
